package homework;

import java.io.*;

public class test03 {
    public static void main(String[] args)  {
        File file = new File("./src/exception");
        FileFilter fileFilter = new FileFilter() {
            @Override
            public boolean accept(File pathname) {
                return pathname.getName().endsWith(".java");
            }
        };
        File [] name = file.listFiles();
        for (File sub : name ){
            try(
            FileInputStream fis = new FileInputStream(file);
            InputStreamReader isr = new InputStreamReader(fis);
            BufferedReader br = new BufferedReader(isr);
            ) {
                String str;
                while ((str = br.readLine()) != null) {
                    System.out.println(str);
                }
            }catch(Exception e){
                System.out.println("报错了");
            }







        }


    }
}
